﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Shop.aspx.cs" Inherits="_2011DBProject.Shop" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<link rel=StyleSheet HREF='design1.css' type='text/css'>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>새벽 골프</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
            <p align =left>
        <asp:Button ID="btnGoLogout" runat="server" onclick="btnGoLogout_onclick" 
            Text="☜ 로 그 아 웃" Width="150px" />
        <asp:Button ID="btnGoServer" runat="server" onclick="btnGoServer_onclick" 
            Text="☜ 서 버 선 택" Width="150px" />
        <asp:Button ID="btnGoCharacter" runat="server" onclick="btnGoCharacter_onclick" 
            Text="☜ 캐 릭 선 택" Width="150px" />
        <asp:Button ID="btnGoChannel" runat="server" onclick="btnGoChannel_onclick" 
            Text="☜ 채 널 선 택" Width="150px" />
        <asp:Button ID="btnGoMain" runat="server" onclick="btnGoMain_onclick" 
            Text="☜ 메 인 화 면" Width="150px" />
        </p>
            <font color="white" size="5px">상점 목록</font><asp:GridView ID="gvShop" runat="server" AutoGenerateColumns="False" 
                CellPadding="4"  DataKeyNames="SHOP_NO"
            DataSourceID="sqldsShop" EmptyDataText="표시할 데이터 레코드가 없습니다." ForeColor="#333333" 
            GridLines="None" HorizontalAlign="Center">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="SHOP_NO" HeaderText="번호" 
                    SortExpression="SHOP_NO" />
                <asp:BoundField DataField="SHOP_OWNER" HeaderText="상점주인" 
                    SortExpression="SHOP_OWNER" />
                <asp:BoundField DataField="SHOP_TYPE" HeaderText="상점종류" 
                    SortExpression="SHOP_TYPE" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="sqldsShop" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            
            SelectCommand="SELECT &quot;SHOP_NO&quot;, &quot;SHOP_TYPE&quot;, &quot;SHOP_OWNER&quot; FROM &quot;SHOP&quot;">
        </asp:SqlDataSource>
        <br />
            <br />
            <br />
            <font color="white" size="5px">상점 취급품</font><br />
            <asp:Button ID="btnBuy" runat="server" Text="선택한 아이템 구입" 
                Width="474px" Height="32px" Visible="False" onclick="btnBuy_Click1" />
        &nbsp;<br />
            <asp:Label ID="lblEnd" runat="server" Font-Size="Large" ForeColor="#FFFF99" 
                Text="정상적으로 구입하였습니다!" Font-Bold="True" Visible="False"></asp:Label>
        <br />
        <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" CellPadding="4"
            DataSourceID="sqldsShopItem" EmptyDataText="표시할 데이터 레코드가 없습니다." 
            ForeColor="#333333" GridLines="None" 
            onselectedindexchanged="GridView2_SelectedIndexChanged" 
            DataKeyNames="SHOP_NO,ITEM_NO" HorizontalAlign="Center">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" SelectText="구입" />
                <asp:BoundField DataField="ITEM_NO" HeaderText="번호" 
                    SortExpression="ITEM_NO" >
                <HeaderStyle Width="30px" />
                </asp:BoundField>
                <asp:BoundField DataField="ITEM_NAME" HeaderText="이름" 
                    SortExpression="ITEM_NAME" >
                <HeaderStyle Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="PRICE" HeaderText="가격" SortExpression="PRICE" />
                <asp:BoundField DataField="MAX_DURABILITY" HeaderText="내구도" 
                    SortExpression="MAX_DURABILITY" />
                <asp:BoundField DataField="POWER_CORRECTION" HeaderText="+파워" 
                    SortExpression="POWER_CORRECTION" />
                <asp:BoundField DataField="IMPACT_CORRECTION" HeaderText="+임팩" 
                    SortExpression="IMPACT_CORRECTION" />
                <asp:BoundField DataField="TECHNIQUE_CORRECTION" 
                    HeaderText="+기술" SortExpression="TECHNIQUE_CORRECTION" />
                <asp:BoundField DataField="STRENGTH_CORRECTION" 
                    HeaderText="+체력" SortExpression="STRENGTH_CORRECTION" />
                <asp:BoundField DataField="USABLE_STAT" HeaderText="요구스탯" 
                    SortExpression="USABLE_STAT" />
                <asp:BoundField DataField="USABLE_LEVEL" HeaderText="요구레벨" 
                    SortExpression="USABLE_LEVEL" />
                <asp:BoundField DataField="USABLE_CHARACTER" HeaderText="요구모델" 
                    SortExpression="USABLE_CHARACTER" />
                <asp:BoundField DataField="USABLE_TITLE" HeaderText="요구타이틀" 
                    SortExpression="USABLE_TITLE" />
                <asp:BoundField DataField="DETAIL_DESCRIPTION" HeaderText="종류" 
                    SortExpression="DETAIL_DESCRIPTION" />
                <asp:BoundField DataField="CATEGORY_DESCRIPTION" 
                    HeaderText="CATEGORY_DESCRIPTION" SortExpression="CATEGORY_DESCRIPTION" 
                    Visible="False" />
                <asp:BoundField DataField="SHOP_OWNER" HeaderText="SHOP_OWNER" 
                    SortExpression="SHOP_OWNER" Visible="False" />
                <asp:BoundField DataField="SHOP_NO" HeaderText="SHOP_NO" 
                    SortExpression="SHOP_NO" Visible="False" />
                <asp:BoundField DataField="BUYING_PRICE" HeaderText="BUYING_PRICE" 
                    SortExpression="BUYING_PRICE" Visible="False" />
                <asp:BoundField DataField="REPAIR_COST" HeaderText="REPAIR_COST" 
                    SortExpression="REPAIR_COST" Visible="False" />
                <asp:BoundField DataField="DISCOUNT_PRICE" HeaderText="할인가" 
                    SortExpression="DISCOUNT_PRICE" />
                <asp:BoundField DataField="REPAIRABILITY" HeaderText="REPAIRABILITY" 
                    SortExpression="REPAIRABILITY" Visible="False" />
                <asp:BoundField DataField="SELLING_PRICE" HeaderText="매입가" 
                    SortExpression="SELLING_PRICE" Visible="False" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                <br />
                <font color="#ffff99">상점을 선택해주세요!</font>
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="sqldsShopItem" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            
            
            
            SelectCommand="SELECT MAX_DURABILITY, PRICE, USABLE_CHARACTER, USABLE_LEVEL, USABLE_STAT, USABLE_TITLE, REPAIR_COST, BUYING_PRICE, DISCOUNT_PRICE, SELLING_PRICE, POWER_CORRECTION, REPAIRABILITY, IMPACT_CORRECTION, TECHNIQUE_CORRECTION, STRENGTH_CORRECTION, ITEM_NAME, CATEGORY_DESCRIPTION, DETAIL_DESCRIPTION, SHOP_OWNER, SHOP_NO, ITEM_NO FROM V_SHOP_ITEM_DETAIL WHERE (SHOP_NO = :SHOP_NO)">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvShop" Name="SHOP_NO" 
                    PropertyName="SelectedValue" Type="Decimal" DefaultValue="0" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
        <br />
        <br />
        <br />
            <font color="white" size="5px">현재 인벤토리</font><br />
            <br />
        <asp:GridView ID="gvMyItem" runat="server" AutoGenerateColumns="False" CellPadding="4" 
            DataSourceID="SqlDataSource2" ForeColor="#333333" GridLines="None" HorizontalAlign="Center">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" />
            <Columns>
                <asp:BoundField DataField="ITEM_NO" HeaderText="템번호" 
                    SortExpression="ITEM_NO" />
                <asp:BoundField DataField="ITEM_NAME" HeaderText="이   름" 
                    SortExpression="ITEM_NAME" >
                <HeaderStyle Width="200px" />
                </asp:BoundField>
                <asp:BoundField DataField="DURABILITY" HeaderText="내구도" 
                    SortExpression="DURABILITY" />
                <asp:BoundField DataField="POWER_CORRECTION" HeaderText="+파워" 
                    SortExpression="POWER_CORRECTION" />
                <asp:BoundField DataField="IMPACT_CORRECTION" 
                    HeaderText="+임팩" SortExpression="IMPACT_CORRECTION" />
                <asp:BoundField DataField="TECHNIQUE_CORRECTION" 
                    HeaderText="+기술" SortExpression="TECHNIQUE_CORRECTION" />
                <asp:BoundField DataField="STRENGTH_CORRECTION" HeaderText="+체력" 
                    SortExpression="STRENGTH_CORRECTION" />
                <asp:BoundField DataField="QTY" HeaderText="수량" SortExpression="QTY" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                <br />
                <font color="#ffff99">인벤토리가 비어 있습니다.</font><br />
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                SelectCommand="SELECT I.ITEM_NAME, M.ITEM_NO, M.DURABILITY, M.POWER_CORRECTION, M.IMPACT_CORRECTION, M.TECHNIQUE_CORRECTION, M.STRENGTH_CORRECTION, M.QTY, M.CHARACTER_NAME, M.SERVER_NO FROM MY_ITEM M, ITEM I WHERE M.ITEM_NO = I.ITEM_NO AND (M.SERVER_NO = :SERVER_NO) AND (M.CHARACTER_NAME = :CHARACTER_NAME)">
                <SelectParameters>
                    <asp:SessionParameter Name="SERVER_NO" SessionField="SERVER" />
                    <asp:SessionParameter Name="CHARACTER_NAME" SessionField="CHARACTER_NAME" />
                </SelectParameters>
            </asp:SqlDataSource>
        <br />
        <br />
    
    </div>
    </form>
</body>
</html>
